package com.csdj.t309.utils;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class RedisUtils {
    private JedisPool jedisPool;
    private Logger log=Logger.getLogger(RedisUtils.class);
    public RedisUtils(String host,String port,String password){
        JedisPoolConfig config=new JedisPoolConfig();
        config.setMaxTotal(20);
        config.setMinIdle(2);
        System.out.println(host);
        jedisPool= new JedisPool(config,host,Integer.parseInt(port),3000,password);
    }
    public static Jedis lianjie(){
        return JedisLianJieChi.Inner.pool.getResource();
    }
}
